import React from "react";
import { Form, Input } from "antd";

interface PropsI {
	formDisabled?: boolean;
	children?: React.ReactElement;
}

const TenantForm: React.FC = (props: PropsI) => {
	const { formDisabled = false } = props;
	const [form] = Form.useForm();

	return (
		<Form form={form} layout="vertical" name={"tenantForm"} autoComplete="off" disabled={formDisabled}>
			<Form.Item
				name="id"
				label="id"
				hidden={!form.getFieldValue("id")}
				rules={[
					{
						required: false,
						message: "请输入id"
					}
				]}>
				<Input disabled={true} />
			</Form.Item>
			<Form.Item
				name="name"
				label="中心名称"
				hasFeedback
				rules={[
					{
						required: true,
						message: "请输入中心名称"
					}
				]}>
				<Input />
			</Form.Item>
		</Form>
	);
};

export default TenantForm;
